<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnsToElOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('el_order', function (Blueprint $table) {
            $table->string('channel')->default('ec')->after('source'); //ec:电商订单；shop：门店订单；integral :积分订单
            $table->integer('channel_id')->default(0)->after('source'); //如果channel=shop，该字段表示门店ID
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('el_order', function (Blueprint $table) {
            $table->dropColumn(['channel', 'channel_id']);
        });
    }
}
